// 结构
<template>
  <nav class="nav_top">
    <!-- roof顶部 -->
    <div class="roof">
      <i class="iconfont icon-saoyisao"></i>
      <span>
        <i class="iconfont icon-xiaoxi"></i>
        <i class="iconfont icon-shezhi"></i>
      </span>
    </div>
    <!-- head:头像 -->
    <div class="nav_top_head">
      <div class="nav_top_head_left">
        <div class="nav_top_head_left_img">
          <div class="head_kuang"></div>
        </div>
        <div class="nav_top_head_left_text">
          <p>
            <i>{{ name }}</i
            ><span>普卡会员</span>
          </p>
          <p>2022 - 09 - 30到期</p>
        </div>
      </div>
      <div class="nav_top_head_right">
        <span class="iconfont icon-erweima"></span>
      </div>
    </div>

    <!-- 会员等级 -->
    <!-- grade等级 -->
    <div class="grade">
      <!-- 等级线 -->
      <u>再消费1500元即可升级</u>
      <div class="line">
        <b></b>
        <span></span>
      </div>
    </div>
    <div class="grade_bottom">
      <ul class="grade_num">
        <li><span>0</span></li>
        <li><span>1500</span></li>
        <li><span>6000</span></li>
        <li><span>10000</span></li>
      </ul>
      <ul class="grade_text">
        <li><span>普卡</span></li>
        <li><span>金卡</span></li>
        <li><span>黑卡</span></li>
        <li><span>钻石</span></li>
      </ul>
    </div>
  </nav>
</template>


// js
<script>
export default {
  name: "Nav",
  data() {
    return {
      name: "",
    };
  },
  created() {
    this.name = sessionStorage.getItem("username");
  },
};
</script>



// 样式
<style>
html,
body {
  height: 100%;
}

body {
  display: flex;
  flex-direction: column;
  font-size: 16px;
}
html {
  font-size: 26.67vw;
}

.nav_top {
  background-color: #292929;
}
.nav_top .roof {
  width: 3.75rem;
  height: 0.6rem;
  line-height: 0.6rem;
}
.nav_top .roof .iconfont {
  color: white;
}
.nav_top .roof i {
  float: left;
  font-size: 0.3rem;
  margin-left: 0.1rem;
}
.nav_top .roof span {
  float: right;
  font-size: 0.3rem;
  margin-right: 0.1rem;
}
.nav_top .roof span i:nth-child(2) {
  margin-left: 0.2rem;
}
.nav_top_head {
  width: 3.75rem;
  height: 1rem;
  display: flex;
  justify-content: space-between;
}
.nav_top_head .nav_top_head_left {
  width: 3.2rem;
  height: 1rem;
  /* background-color: aqua; */
  display: flex;
  justify-content: flex-start;
}
.nav_top_head .nav_top_head_left_img {
  width: 0.7rem;
  height: 1rem;
  /* background-color: palegreen; */
  box-sizing: border-box;
  padding-top: 0.2rem;
}
.nav_top_head .head_kuang {
  width: 0.6rem;
  height: 0.6rem;
  border-radius: 50%;
  background-color: aliceblue;
  float: right;
  background: url("/image/touxiang.jpg");
  background-size: 0.6rem 0.6rem;
}
.nav_top_head_left_text {
  margin-left: 0.1rem;
}
.nav_top_head_left_text i {
  color: white;
  font-size: 0.18rem;
}
.nav_top_head_left_text span {
  background-color: #e7cfb3;
  font-size: 0.16rem;
  border-radius: 20px;
  padding: 0 0.02rem 0 0.1rem;
}
.nav_top_head_left_text p:nth-child(1) {
  padding-top: 0.2rem;
}
.nav_top_head_left_text p:nth-child(2) {
  color: rgb(139, 139, 139);
  padding-top: 0.1rem;
}
.nav_top_head_right span {
  color: white;
  font-size: 0.25rem;
  margin-right: 0.15rem;
  line-height: 0.73rem;
}
.grade {
  width: 3.75rem;
  height: 0.2rem;
  /* background-color: antiquewhite; */
  box-sizing: border-box;
  position: relative;
}
.grade .line {
  margin-top: 0.4rem;
  position: relative;
}
.grade u {
  position: absolute;
  top: -0.27rem;
  left: 0.1rem;
  background-color: aliceblue;
  border-radius: 0.2rem;
  padding: 0 0.05rem;
}
.grade .line b {
  display: block;
  width: 0.15rem;
  height: 0.15rem;
  background-color: #e7cfb3;
  border-radius: 50%;
  position: absolute;
  left: 0.28rem;
}
.grade .line span {
  width: 3rem;
  height: 0.04rem;
  background-color: aliceblue;
  display: flex;
  left: 0.32rem;
  position: absolute;
  top: 0.05rem;
}
.grade_bottom {
  width: 3.5rem;
  height: 0.6rem;
  /* background-color: aqua; */
  margin: auto;
}
.grade_bottom ul {
  width: 3.3rem;
}
.grade_bottom li {
  width: 0.6rem;
  text-align: center;
}
.grade_num {
  display: flex;
  justify-content: space-between;
  margin-right: 20px;
}
.grade_num span {
  color: rgb(139, 139, 139);
}
.grade_text {
  width: 3.3rem;
  display: flex;
  justify-content: space-between;
}
.grade_text span {
  text-align: center;

  color: rgb(139, 139, 139);
}
</style>